package configuration;

import java.io.File;

import main.Core;
import main.RPGArchitect;

public class Paths {

	public static String jarPath;
	public static String databasePath;
	public static String propertiesPath;
	public static String characterDataPath;
	public static String dialogDataPath;
	public static String projectDataPath;

	public static void setupPaths() {
		if (!Core.getInstance().debugMode()) {
			Paths.jarPath = RPGArchitect.class.getProtectionDomain()
					.getCodeSource().getLocation().getPath().toString();
		} else {
			Paths.jarPath = ".";
		}
		Paths.databasePath = Paths.jarPath + File.separatorChar + "database";
		Paths.propertiesPath = Paths.jarPath
				+ File.separatorChar
				+ "properties";
		Paths.characterDataPath = Paths.databasePath
				+ File.separatorChar
				+ "character";
		Paths.dialogDataPath = Paths.databasePath
				+ File.separatorChar
				+ "dialog";
		Paths.projectDataPath = Paths.databasePath
				+ File.separatorChar
				+ "project_data";

		// String temp = new String(Paths.jarPath + "database/project_data");
		// Paths.projectDataPath = temp.substring(1);
		System.err.println(File.separator);
		System.err.println(Paths.jarPath);
		Paths.projectDataPath = "C:/Users/Richard/Documents/Eclipse Workspace/RPG Architect/bin/database/project_data";
	}
}
